<?php


namespace App\Http\Controllers\Admin\View;


use App\Http\Controllers\Controller;
use App\Http\Repositories\Services\IBrand;

class BrandController extends Controller
{
    protected $brandService;

    public function __construct(IBrand $brandService)
    {
        $this->brandService = $brandService;
    }

    public function index()
    {
        return view('admin.brand.index');
    }

    public function store($pid)
    {
        $tree = $this->brandService->getAll();
        return view('admin.brand.create',compact('pid','tree'));
    }

    public function update($id)
    {
        $dao = $this->brandService->byId($id);
        $tree = $this->brandService->getAll();
        return view('admin.brand.edit',compact('dao','tree'));
    }
}